/**
 * @param {string} s
 * @param {string} t
 * @return {boolean}
 */
 var isAnagram = function(s, t) {
  if (s.length !== t.length) {
      return false
  }
  var arr = new Array(26)
  arr.fill(0)
  var baseCode = 'a'.codePointAt(0)
  for(var i=0;i<s.length;i++) {
      arr[s.codePointAt(i)-baseCode]++
  }
  for(var i=0;i<t.length;i++) {
      arr[t.codePointAt(i)-baseCode]--
      if (arr[t.codePointAt(i)-baseCode]<0) {
          return false
      }
  }
  return true
};

isAnagram('a', 'b')